﻿@{ Layout = "../Shared/_Layout.cshtml"; }
@section Navs{
<template v-if="pageType == $pageTypeAdmin">
  <li class="nav-item">
    <a class="nav-link active" href="pageAdministrator.aspx">管理员管理</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="pageAdminRole.aspx">角色管理</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="pageAdminConfiguration.aspx">管理员设置</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="pageAdminDepartment.aspx">所属部门管理</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="pageAdminArea.aspx">所在区域管理</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="adminAccessTokens.cshtml">API密钥管理</a>
  </li>
</template>
<template v-else-if="pageType == $pageTypeUser">
  <li class="nav-item">
    <a class="nav-link" :href="'adminView.cshtml?pageType=' + $pageTypeUser + '&userId=' + userId">查看资料</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" :href="'adminProfile.cshtml?pageType=' + $pageTypeUser + '&userId=' + userId">修改资料</a>
  </li>
  <li class="nav-item">
    <a class="nav-link active" :href="'adminPassword.cshtml?pageType=' + $pageTypeUser + '&userId=' + userId">更改密码</a>
  </li>
</template>
}

<template v-if="pageType == $pageTypeAdmin">
  <div class="header-title">更改密码</div>
  <p class="text-muted font-13 m-b-25"></p>
</template>

<div class="form-group">
  <label class="col-form-label">
    账号
  </label>
  <input :value="adminInfo.userName" :disabled="true" type="text" class="form-control" />
  <small class="form-text text-muted">帐号用于登录系统，由字母、数字组成</small>
</div>

<div class="form-group">
  <label class="col-form-label">
    密码
    <small v-show="errors.has('password')" class="text-danger">{{ errors.first('password') }}</small>
  </label>
  <input v-model="password" type="password" class="form-control" name="password" data-vv-as="密码" v-validate="'required'" :class="{'is-invalid': errors.has('password') }">
</div>
<div class="form-group">
  <label class="col-form-label">
    确认密码
    <small v-if="errors.has('confirmPassword')" class="text-danger">{{ errors.first('confirmPassword') }}</small>
    <small v-else-if="password != confirmPassword" class="text-danger">确认密码和密码不一致</small>
  </label>
  <input type="password" v-model="confirmPassword" name="confirmPassword" class="form-control" data-vv-as="确认密码" v-validate="'required'" :class="{'is-invalid':
errors.has('confirmPassword') || password != confirmPassword}">
</div>

<hr />

<div class="text-center">
  <button class="btn btn-primary" v-on:click="btnSubmitClick">确 定</button>
  <button v-if="pageType == $pageTypeAdmin" class="btn ml-1" v-on:click="btnReturnClick">返 回</button>
</div>

@section Scripts{
<script src="adminPassword.js" type="text/javascript"></script> }